import Vue from "vue";
import VueRouter from "vue-router";

import Register from "@/views/Register";
import Login from "@/views/Login";

import Index from "@/views/Index";
import Dashboard from "@/views/Dashboard";
import Score from "@/views/Score";
import Student from "@/views/Student";

Vue.use(VueRouter);

const routes = [
  { path: "/register", component: Register },
  { path: "/login", component: Login },
  {
    path: "/",
    component: Index,
    redirect: "/dashboard",
    children: [
      { path: "dashboard", component: Dashboard },
      { path: "score", component: Score },
      { path: "student", component: Student },
    ],
  },
  { path: "/index", component: Index },
];

const router = new VueRouter({
  routes,
});

export default router;
